$(".side-menu dl dt i").each(function (index, value) {
  var a = 0;
  $(value).click(function () {
    if (a == 0) {
      a = 1;
      $(value).attr("class", "jia");
      $(value)
        .parent()
        .next()
        .animate(
          {
            height: 0,
          },
          300,
          function () {
            $(value).parent().next().css("display", "none");
          }
        );
    } else {
      a = 0;
      $(value).attr("class", "jian");
      $(value).parent().next().css("display", "block");
      $(value).parent().next().animate(
        {
          height: "100%",
        },
        300
      );
    }
  });
});
$("#collect").click(function () {
  $(this).css("color", "red");
  $("#service").css("color", "");
  $(".user-index-order").remove();
  $(".user-index-wallet").remove();
  $(".user-perinfo .account").remove();
  $(".user-perinfo .avatar").css({ width: "40px", height: "40px" });
  $(".user-perinfo .avatar img").css({ width: "40px", height: "40px" });

  $(".user-main .user-mod").html(
    `
    <div class="user-collect">
    <div class="user-title">
      <h2>我的收藏</h2>
      <ul class="tabs">
        <li class="active">
          <a href="javascript:void(0);">收藏商品</a>
        </li>
        <li><a href="javascript:void(0);">关注店铺</a></li>
        <li><a href="javascript:void(0);">关注品牌</a></li>
      </ul>
    </div>
    <div class="user-index-order-list">
      <div class="no_records">
        <i class="no_icon"></i>
        <div class="no_info no_info_line">
          <h3>主人，您还没有收藏任何商品哟~</h3>
        </div>
      </div>
    </div>
  </div>
        `
  );
  $(".tabs li").click(function () {
    $(this).attr("class", "active").siblings().attr("class", "");
    console.log();
    if ($(this).children().text().includes("商品")) {
      $(".no_info_line").children().text("主人，您还没有收藏任何商品哟~");
    }
    if ($(this).children().text().includes("店铺")) {
      $(".no_info_line").children().text("主人，您还没有关注任何店铺哟~");
    }
    if ($(this).children().text().includes("品牌")) {
      $(".no_info_line").children().text("主人，您还没有关注任何品牌哟~");
    }
  });
});
$("#service").click(function () {
  $(this).css("color", "red");
  $("#collect").css("color", "");
  $(".user-main .user-mod").html(
    `
    <div class="user-service">
    <div class="user-title">
      <h2>意见建议</h2>
    </div>
    <div class="user-index-order-list">
      <div class="user-items">
        <div class="item">
          <div class="label">
            <em class="red">*</em>&nbsp;留言类型：
          </div>
          <div class="value">
            <div class="radio-item">
              <input type="radio" name="rir" checked="" value="0" />
              <label for="checkbox-message" class="ui-radio-label"
                >留言</label
              >
            </div>
            <div class="radio-item">
              <input type="radio" name="rir" value="1" />
              <label for="checkbox-complaint" class="ui-radio-label"
                >投诉</label
              >
            </div>
            <div class="radio-item">
              <input type="radio" name="rir" value="2" />
              <label for="checkbox-ask" class="ui-radio-label"
                >询问</label
              >
            </div>
            <div class="radio-item">
              <input type="radio" name="rir" value="3" />
              <label for="checkbox-customer" class="ui-radio-label"
                >售后</label
              >
            </div>
            <div class="radio-item">
              <input type="radio" name="rir" value="4" />
              <label for="checkbox-buy" class="ui-radio-label"
                >求购</label
              >
            </div>
          </div>
        </div>
        <div class="item">
          <div class="label">
            <em class="red">*</em>&nbsp;留言主题：
          </div>
          <div class="value">
            <input type="text" class="text text2" />
            <div class="form_prompt"></div>
          </div>
        </div>
        <div class="item">
          <div class="label">
            <em class="red">*</em>&nbsp;留言内容：
          </div>
          <div class="value">
            <textarea
              name="msg_content"
              class="textarea textarea2"
            ></textarea>
            <div class="form_prompt"></div>
          </div>
        </div>
        <div class="item">
          <div class="label">&nbsp;</div>
          <div class="value">
            <div class="value-file">
              <input
                type="button"
                class="sc-btn sc-redBg-btn"
                value="选择文件"
              />
            </div>
            <span class="remind"
              >仅支持gif、jpg、png、word、excel、txt、zip、ppt、pdf
              ，附件大小不得超过64KB。</span
            >
          </div>
        </div>
        <div class="item">
          <div class="label"><em class="red">*</em>&nbsp;验证码：</div>
          <div class="item-value">
            <div class="captcha_input">
              <input type="text" class="text" />
              <img src="" class="captcha_img" onclick="this.src=''" />
            </div>
            <div class="form_prompt"></div>
          </div>
        </div>
        <div class="item item-button">
          <div class="label">&nbsp;</div>
          <div class="value">
            <input type="button" class="sc-btn" value="提交" />
          </div>
        </div>
        <div class="clear"></div>
      </div>
    </div>
    <div class="user-title">
      <h2>留言</h2>
      <ul class="tabs">
        <li class="active">
          <a href="javascript:void(0);">普通留言</a>
        </li>
        <li><a href="javascript:void(0);">订单留言</a></li>
      </ul>
    </div>
    <div class="user-index-order-list">
      <div class="no_records">
        <i class="no_icon"></i>
        <div class="no_info no_info_line">
          <h3>暂无数据</h3>
        </div>
      </div>
    </div>
  </div>
</div>
        `
  );
  $(".tabs li").click(function () {
    $(this).attr("class", "active").siblings().attr("class", "");
  });
  $(".ui-radio-label").click(function () {
    $(this).prev().attr("checked", "");
    $(this).parent().siblings().find("input").removeAttr("checked");
    if ($(this).prev().attr("checked", "")) {
      $(this).css({
        background: "url(../img/radio_checked.png) 0 0px no-repeat",
      });
    }
    $(this).parent().siblings().find("label").css({
      background: "",
    });
  });
});
